﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MsTestUtilities.SolutionAnalysis;
using MsTestUtilities.SolutionAnalysis.Testing;

namespace SolutionAnalysisTests
{
    [TestClass]
    public class CsProjectTests
    {
        private CsProject project;

        [TestInitialize]
        public void Setup()
        {
            project = CsProject.LoadFromFile(@"TestFiles\Common.csproj");                
        }

        [TestMethod]
        public void OutputTypeTest()
        {
            Assert.AreEqual(OutputType.Library, project.OutputType);
        }

        [TestMethod]
        public void ContentFilesTest()
        {
            var assert = new ProjectAssert(new[] { project });
            assert.ForAllContentFiles()
                .DoesntHaveCopyAlways();
        }

        [TestMethod]
        public void References()
        {
            var assert = new ProjectAssert(new[] { project });
            assert.ForAllReferences()
                .Where(r => !r.Path.StartsWith("System"))                
                .IsFalse(i => i.Path.StartsWith("System"));
        }
    }
}
